import request from '@/utils/request'
export function getPlayerListApi(params: any) {
  return request({
    url: '/api/player',
    method: 'get',
    params,
  })
}
export function getPlayerVariableApi(activityId: string) {
  return request({
    url: `/api/player/variable/${activityId}`,
    method: 'get',
  })
}
export function addPlayerApi(data: any) {
  return request({
    url: '/api/player',
    method: 'post',
    data,
  })
}
export function putPlayerApi(data: any) {
  return request({
    url: `/api/player/${data.id}`,
    method: 'put',
    data,
  })
}

export function delPlayerApi(id: string | string[]) {
  return request({
    url: `/api/player/${id}`,
    method: 'delete',
  })
}
// 批量审核通过
export function allCheckPlayerApi(id: string | string[]) {
  return request({
    url: `/api/player/check/${id}`,
    method: 'put',
  })
}
export function allNoCheckPlayerApi(id: string | string[]) {
  return request({
    url: `/api/player/noCheck/${id}`,
    method: 'put',
  })
}

export function exportPlayerApi(data: any) {
  return request({
    url: '/api/player/export',
    method: 'post',
    data,
  })
}
export function importTemplatePlayerApi(data: any) {
  return request({
    url: '/api/player/import/template',
    method: 'post',
    data,
  })
}
export function importPlayer(data: any, activityId?: string) {
  return request({
    url: `/api/player/import?activityId=${activityId}`,
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  })
}

export function getPlayerDetailApi(id: string) {
  return request({
    url: `/api/player/show/${id}`,
    method: 'get',
  })
}

export function affirmUpdateApi(id: string) {
  return request({
    url: `/api/player/affirmUpdate/${id}`,
    method: 'get',
  })
}

export function getHistoryApi(params: any) {
  return request({
    url: `/api/player/history`,
    method: 'get',
    params,
  })
}
